package a.j;

import a.c.z;
import a.d.w;

import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.util.Collection;
import java.util.Iterator;

public class tf
  extends gf
{
  private b_ m;
  private double G = 2.0D;
  private int H = 100;
  private MouseWheelListener[] I;
  private MouseWheelListener J;
  private boolean K = true;
  private pg L;
  public static boolean M;
  
  public tf()
  {
    a("NAVIGATION_MAGNIFIER");
  }
  
  public void mouseMoved(double paramDouble1, double paramDouble2)
  {
    b(paramDouble1, paramDouble2);
  }
  
  public void mouseDraggedLeft(double paramDouble1, double paramDouble2)
  {
    b(paramDouble1, paramDouble2);
  }
  
  public void mouseDraggedRight(double paramDouble1, double paramDouble2)
  {
    b(paramDouble1, paramDouble2);
  }
  
  public void mouseExited(MouseEvent paramMouseEvent)
  {
    super.mouseExited(paramMouseEvent);
    if (!ld.E)
    {
      if (this.m != null)
      {
        this.i.b(this.m);
        this.m = null;
      }
    }
    else {
      this.i.b();
    }
  }
  
  protected pg v()
  {
    pg localpg = new pg(k());
    localpg.g(this.i.ab());
    localpg.d(this.i.v());
    localpg.a(this.i.w());
    localpg.a(this.i.y());
    localpg.c(this.i.x());
    localpg.a(this.i.W());
    localpg.c(0.0D);
    localpg.a(21, 31);
    localpg.a(new c_(localpg, this.i));
    return localpg;
  }
  
  public void b(boolean paramBoolean)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    JComponent localJComponent;
    int i;
    if (!bool2)
    {
      if (paramBoolean)
      {
        localJComponent = this.i.B();
        if (!bool2)
        {
          if (this.K)
          {
            this.I = localJComponent.getMouseWheelListeners();
            i = 0;
            do
            {
              if (i >= this.I.length) {
                break;
              }
              if (bool2) {
                break label108;
              }
              localJComponent.removeMouseWheelListener(this.I[i]);
              i++;
              if (bool1) {
                break label103;
              }
            } while (!bool1);
            if (bool2) {
              break label112;
            }
            this.J = new a_();
            label103:
            label108:
            localJComponent.addMouseWheelListener(this.J);
          }
          label112:
          a(true);
        }
        if (!bool2) {
          if (!bool1) {
            return;
          }
        }
      }
      else
      {
        a(false);
        this.i.b(this.m);
        this.m = null;
        k().c(this.L);
        this.L = null;
      }
    }
    else
    {
      localJComponent = this.i.B();
      if (bool2) {
        break label253;
      }
    }
    if (this.K)
    {
      if (!bool2)
      {
        if (this.J != null) {
          localJComponent.removeMouseWheelListener(this.J);
        }
      }
      else {
        this.J = null;
      }
      i = 0;
      do
      {
        if (i >= this.I.length) {
          break;
        }
        localJComponent.addMouseWheelListener(this.I[i]);
        i++;
        if ((!bool2) && (bool1)) {
          return;
        }
      } while (!bool1);
    }
    if (!bool2) {
      label253:
      this.i.b();
    }
  }
  
  private void b(double paramDouble1, double paramDouble2)
  {
    boolean bool = ld.E;
    if (!bool) {
      if (!a()) {
        a(true);
      }
    }
    if (!bool) {
      if (this.m == null)
      {
        this.L = v();
        this.m = new b_(this.L);
        this.m.a(this.G);
        this.m.a(this.H);
        this.i.a(this.m);
        this.m.a(new w(paramDouble1, paramDouble2));
      }
    }
    Rectangle2D localRectangle2D = this.m.a();
    this.m.a(new w(paramDouble1, paramDouble2));
    localRectangle2D.add(this.m.a());
    double d = 5.0D / this.i.M();
    localRectangle2D.setFrame(localRectangle2D.getX() - d, localRectangle2D.getY() - d, localRectangle2D.getWidth() + 2.0D * d, localRectangle2D.getHeight() + 2.0D * d);
    this.i.a(localRectangle2D);
  }
  
  public void c(double paramDouble)
  {
    boolean bool = ld.E;
    if (!bool)
    {
      if (this.G != paramDouble) {
        this.G = paramDouble;
      }
    }
    else if ((bool) || (this.m != null))
    {
      this.m.a(paramDouble);
      this.i.b();
    }
  }
  
  public double w()
  {
    return this.G;
  }
  
  public void d(int paramInt)
  {
    if (paramInt != this.H)
    {
      this.H = paramInt;
      if ((ld.E) || (this.m != null))
      {
        this.m.a(this.H);
        this.i.b();
      }
    }
  }
  
  public int x()
  {
    return this.H;
  }
  
  public void mouseWheelMoved(MouseWheelEvent paramMouseWheelEvent)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    int i = 0;
    if (!bool2) {
      if (paramMouseWheelEvent.getScrollType() == 1)
      {
        i = paramMouseWheelEvent.getWheelRotation();
        if (bool2) {
          break label58;
        }
        if (!bool1) {
          break label57;
        }
      }
    }
    if (!bool2) {
      if (paramMouseWheelEvent.getScrollType() == 0) {
        i = paramMouseWheelEvent.getUnitsToScroll();
      }
    }
    label57:
    label58:
    if ((bool2) || (i != 0))
    {
      if (!bool2) {
        if ((paramMouseWheelEvent.getModifiers() & 0x2) == 0)
        {
          double d = a(this.G, i);
          c(d);
          if ((!bool2) && (!bool1)) {
            return;
          }
        }
      }
      int j = b(this.H, i);
      d(j);
    }
  }
  
  protected int b(int paramInt1, int paramInt2)
  {
    int i = 10;
    if (!ld.E) {
      if (paramInt2 == 0) {
        return paramInt1;
      }
    }
    return Math.max(i, paramInt1 + paramInt2 * i);
  }
  
  protected double a(double paramDouble, int paramInt)
  {
    if (!ld.E) {
      if (paramInt == 0) {
        return paramDouble;
      }
    }
    double d = paramInt > 0 ? paramDouble / 1.25D : paramDouble * 1.25D;
    return Math.max(1.0D, d);
  }
  
  public boolean y()
  {
    return this.K;
  }
  
  public void g(boolean paramBoolean)
  {
    this.K = paramBoolean;
  }
  
  private static final class c_
    extends jb
  {
    private final pg p;
    
    c_(pg parampg1, pg parampg2)
    {
      super();
      this.p = parampg2;
    }
    
    public void a(Graphics2D paramGraphics2D, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
    {
      c(this.p);
      try
      {
        super.a(paramGraphics2D, paramInt1, paramInt2, paramInt3, paramInt4);
      }
      finally
      {
        g();
      }
    }
    
    protected void h(Graphics2D paramGraphics2D) {}
    
    protected void i(Graphics2D paramGraphics2D) {}
    
    void d(Graphics2D paramGraphics2D)
    {
      h(paramGraphics2D);
      Image localImage = c();
      int i = localImage.getWidth(null);
      int j = localImage.getHeight(null);
      int k = this.p.getWidth();
      int m = this.p.getHeight();
      paramGraphics2D.drawImage(localImage, (k - i) / 2, (m - j) / 2, null);
    }
    
    private void c(pg parampg)
    {
      db localdb = parampg.Y();
      if ((localdb instanceof jb)) {
        a((jb)localdb);
      }
    }
    
    private void a(jb paramjb)
    {
      a(paramjb.d());
      a(paramjb.c());
      Point localPoint = paramjb.e();
      a(localPoint.getX(), localPoint.getY());
      a(paramjb.f());
    }
    
    private void g()
    {
      a(Color.WHITE);
      a(null);
      a(0.0D, 0.0D);
      a((byte)4);
    }
  }
  
  class a_
    implements MouseWheelListener
  {
    a_() {}
    
    public void mouseWheelMoved(MouseWheelEvent paramMouseWheelEvent)
    {
      tf.this.mouseWheelMoved(paramMouseWheelEvent);
    }
  }
  
  class b_
    implements qb
  {
    private static final int a = 16777215;
    private w b = w.c;
    private int c = 100;
    private double d = 2.0D;
    private pg e;
    private BufferedImage f;
    private boolean g = true;
    z h = new z();
    
    b_(pg parampg)
    {
      this.e = parampg;
    }
    
    public void paint(Graphics2D paramGraphics2D)
    {
      boolean bool2 = ld.E;
      boolean bool1 = ld.D;
      if (!bool2) {
        if (this.g)
        {
          tf.this.i.a(this);
          tf.this.i.b(this);
          this.g = false;
          return;
        }
      }
      this.g = true;
      Graphics2D localGraphics2D1 = (Graphics2D)paramGraphics2D.create();
      Rectangle2D localRectangle2D = a();
      Ellipse2D.Double localDouble = new Ellipse2D.Double();
      localDouble.setFrame(localRectangle2D);
      double d1 = tf.this.i.M();
      double d2 = 1.0D / d1;
      if (!bool2)
      {
        if (this.d != 1.0D)
        {
          Shape localShape = localGraphics2D1.getClip();
          AffineTransform localAffineTransform = localGraphics2D1.getTransform();
          if (!bool2)
          {
            if (tf.this.i.getClientProperty("MagnifierViewMode.noDoubleBuffering") == null)
            {
              localGraphics2D1.translate(localRectangle2D.getX(), localRectangle2D.getY());
              int i = this.c;
              int j = 2 * i;
              if (!bool2) {
                if (this.f != null)
                {
                  if (bool2) {
                    break label218;
                  }
                  if (this.f.getWidth() >= j)
                  {
                    if (bool2) {
                      break label234;
                    }
                    if (this.f.getHeight() >= j) {
                      break label230;
                    }
                  }
                }
              }
              label218:
              this.f = a(localGraphics2D1, j, j);
              label230:
              label234:
              Graphics2D localGraphics2D2 = this.f.createGraphics();
              localGraphics2D2.addRenderingHints(localGraphics2D1.getRenderingHints());
              localGraphics2D2.setClip(0, 0, j, j);
              b();
              g localg = tf.this.k();
              this.e.b(localg);
              this.e.setSize(j, j);
              this.e.b(this.d * d1);
              this.e.a(this.b.a, this.b.b);
              this.e.a(localGraphics2D2);
              localg.c(this.e);
              c();
              localGraphics2D2.dispose();
              int k = i * i;
              int m = 0;
              label469:
              do
              {
                if (m >= j) {
                  break;
                }
                if (bool2) {
                  break label524;
                }
                if (bool1) {
                  break label516;
                }
                int n = 0;
                do
                {
                  do
                  {
                    if (n >= j) {
                      break label469;
                    }
                    int i1 = m - i;
                    int i2 = n - i;
                    if (bool1) {
                      break;
                    }
                    if (i1 * i1 + i2 * i2 > k)
                    {
                      this.f.setRGB(m, n, 16777215);
                      if (bool2) {
                        continue;
                      }
                      if (!bool1) {}
                    }
                    else
                    {
                      n = Math.max(n, j - n);
                    }
                    n++;
                  } while (!bool1);
                  m++;
                } while (bool2);
              } while (!bool1);
              localGraphics2D1.scale(d2, d2);
              if (bool2) {
                break label557;
              }
              label516:
              localGraphics2D1.drawImage(this.f, 0, 0, j, j, 0, 0, j, j, null);
              if (bool2) {
                break label556;
              }
              label524:
              if (!bool1) {}
            }
            else
            {
              localGraphics2D1.clip(localDouble);
              localGraphics2D1.translate(localRectangle2D.getX(), localRectangle2D.getY());
            }
          }
          else {
            a(localGraphics2D1);
          }
          localGraphics2D1.setTransform(localAffineTransform);
          label556:
          label557:
          localGraphics2D1.setClip(localShape);
        }
        localGraphics2D1.setColor(Color.BLACK);
        localGraphics2D1.setStroke(new BasicStroke((float)(1.5D * d2)));
        localGraphics2D1.draw(localDouble);
        localGraphics2D1.dispose();
      }
    }
    
    private void a(Graphics2D paramGraphics2D)
    {
      b();
      g localg = tf.this.k();
      this.e.b(localg);
      double d1 = 20.0D / tf.this.i.M();
      this.e.setSize((int)(2 * this.c / tf.this.i.M()), (int)(2 * this.c / tf.this.i.M()));
      this.e.b(this.d);
      this.e.a(this.b.a, this.b.b);
      this.e.setSize((int)(2 * this.c / tf.this.i.M()), (int)(2 * this.c / tf.this.i.M() + d1));
      this.e.a(paramGraphics2D);
      localg.c(this.e);
      c();
    }
    
    public Rectangle2D a()
    {
      Rectangle2D.Double localDouble = new Rectangle2D.Double();
      double d1 = this.c / tf.this.i.M();
      localDouble.setFrame(this.b.a - d1, this.b.b - d1, 2.0D * d1, 2.0D * d1);
      return localDouble;
    }
    
    public void b()
    {
      boolean bool2 = ld.E;
      boolean bool1 = ld.D;
      Collection localCollection = tf.this.i.U();
      Iterator localIterator = localCollection.iterator();
      do
      {
        do
        {
          qb localqb;
          do
          {
            if (!localIterator.hasNext()) {
              break;
            }
            localqb = (qb)localIterator.next();
          } while (localqb == tf.this.m);
          this.h.c(localqb);
          this.e.a(localqb);
        } while (bool2);
      } while (!bool1);
    }
    
    public void c()
    {
      boolean bool = ld.D;
      do
      {
        if (this.h.isEmpty()) {
          break;
        }
        qb localqb = (qb)this.h.b();
        this.e.b(localqb);
      } while (!bool);
    }
    
    public Rectangle getBounds()
    {
      Rectangle localRectangle = new Rectangle();
      localRectangle.setFrame(a());
      return localRectangle;
    }
    
    public void a(w paramw)
    {
      this.b = paramw;
    }
    
    public w d()
    {
      return this.b;
    }
    
    public int e()
    {
      return this.c;
    }
    
    public void a(int paramInt)
    {
      this.c = paramInt;
    }
    
    public double f()
    {
      return this.d;
    }
    
    public void a(double paramDouble)
    {
      this.d = paramDouble;
    }
    
    private BufferedImage a(Graphics2D paramGraphics2D, int paramInt1, int paramInt2)
    {
      GraphicsConfiguration localGraphicsConfiguration = paramGraphics2D.getDeviceConfiguration();
      if ((ld.E) || (localGraphicsConfiguration != null)) {
        return localGraphicsConfiguration.createCompatibleImage(paramInt1, paramInt2, 3);
      }
      return new BufferedImage(paramInt1, paramInt2, 2);
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.j.tf

 * JD-Core Version:    0.7.0.1

 */